<%= form_for(@invoice, :html => {:class => "s-form"}) do |f| %>
<% if @invoice.errors.any? %>
<div id="error_explanation">
	<h2><%= pluralize(@invoice.errors.count, "error") %> prohibited this invoice from being saved:</h2>

	<ul>
		<% @invoice.errors.full_messages.each do |msg| %>
		<li>
			<%= msg %>
		</li>
		<% end %>
	</ul>
</div>
<% end %>

<div class="s-inline-form">
	<%= f.label :Select_Customer %>
	<%= f.collection_select(:customer_id, Customer.all, :id, :company, :prompt => true) %>
	<%= link_to_add_fields "Add Product", f, :invoice_items %>
</div>

<table>
	<thead>
		<tr>
			<th>Product</th>
			<th>Size</th>
			<th>Size Number</th>
			<th>Quantity</th>
			<th></th>
		</tr>
	</thead>
	<tbody>
		<%= f.fields_for :invoice_items do |builder| %>
		<%= render "invoice_item_fields", :f => builder %>
		<% end %>
	</tbody>
</table>

<div class="actions">
	<%= f.submit :class => 'gray-btn' %>
</div>

<% end %>
